/* eslint-disable no-undef */
Component({
  behaviors: [],
  properties: {},
  data: {
    isLogin: false,
  },
  methods: {},
  lifetimes: {
    created() {},
    attached() {},
    moved() {},
    detached() {},
  },
  pageLifetimes: {
    show() {
      const isLogin = !!getApp().token
      this.setData({ isLogin })
      if (!isLogin) {
        wx.utils.redirectToLogin()
      }
    },
  },
})
